<template>
	<view>
		<!-- TODO:页面样式未处理 -->
		<view style="background: var(--themeBackground);">
			<appBar title="课程详情"></appBar>
			<view class="borderbottom">
				<tabsComponent :tabsList="list" @handleTabClick="click" />
			</view>
			<view style="padding: 20rpx;">
				<uv-image :src="courseDeail.imageUrl" width="100%" ></uv-image>
				<view style="margin: 40rpx 0rpx;font-size: 36rpx;font-weight: 700;">
					{{courseDeail.title}}
				</view>
				<view v-html="courseDeail.content"></view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import { ref } from 'vue'
import {
		courseDetailApi
	} from '@/api/mine.js'
	import {
		onLoad
	} from '@dcloudio/uni-app'


	// 课程详情
	let courseDeail = ref()

	// 获取课程详情
	const getCourseDetail = async (id) => {
		let res = await courseDetailApi(id)
		console.log(res.data);
		courseDeail.value = res.data
	}

	// 页面加载
	onLoad((option) => {
		getCourseDetail(option.id)
	})
</script>

<style lang="scss" scoped>

</style>